<template>
	<view>
		<u-navbar :title="title" :background="{ background: '#a0cfff' }" title-color="#FFFFFF"></u-navbar>
		<view class="shopTop u-p-30">
			<view class="title">{{consent.title}}</view>
			<view class="look">浏览：{{consent.look}}次</view>
		</view>
		<view class="content u-p-30">
			<view class="user">
				<view>
					<image :src="consent.user.userUrl" style="width: 80rpx;height: 80rpx;border: 1rpx solid #C8C9CC;border-radius: 50%;"></image>
				</view>
				<view class="userN">
					<view class="userName">{{consent.user.username}}</view>
					<view class="userTime">时间：{{consent.creatTime}}</view>
				</view>
			</view>
			<view class="cont">
				{{consent.content}}
			</view>
			<view class="Image u-m-t-30">
				<image :src="item" style="width: 100%;height: 500rpx;border: 1rpx solid #C8C9CC;" v-for="(item,index) in consent.fileUrl" :key="index"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import time from '../../common/time.js'
	import helper from '../../common/helper.js'
	export default {
		data() {
			return {
				id: '',
				title:'',
				consentId: '',
				consent: {}
			}
		},
		onLoad(options) {
			if(options.id){
				this.id = options.id
			}
			if(options.title){
				this.title = options.title
			}
			if(options.consentId){
				this.consentId = options.consentId
			}
			this.getConsent()
		},
		methods: {
			getConsent(){
				let that = this
				let data = {
					id: that.id
				}
				that.postRequest(helper.getIn,data).then(res => {
					if(res.data.flag == "200"){
						let serve = res.data.invn
						if(serve.fileUrl.indexOf("<<tupian>>") > 0){
							serve.fileUrl = serve.fileUrl.split("<<tupian>>")
						}else{
							serve.fileUrl = serve.fileUrl.split("<<tupian>>")
						}
						serve.creatTime = that.formatDateTime(serve.creatTime)
						that.consent = serve
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.shopTop{
	border-bottom: 1rpx #C8C9CC solid;
	.title{
		font-size: 40rpx;
		font-weight: bold;
	}
	.look{
		font-size: 24rpx;
		color: #C8C9CC;
		margin-top: 5rpx;
	}
}
.content{
	.user{
		display: flex;
		align-items: center;
		.userN{
			margin-left: 15rpx;
			.userName{
				font-size: 30rpx;
				font-weight: bold;
			}
			.userTime{
				font-size: 24rpx;
				color: #C8C9CC;
				margin-top: 5rpx;
			}
		}
	}
	.cont{
		margin-top: 15rpx;
		font-size: 28rpx;
	}
	.Image{
		
	}
}
</style>
